/*
 ============================================================================
 Name		: CConfiguration.h
 Author	  : Lenka Litvova
 Version	 : 1.0
 Copyright   : Copyright belongs to Lenka Litvova
 Description : CCConfiguration declaration
 ============================================================================
 */

#ifndef CCONFIGURATION_H
#define CCONFIGURATION_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>

_LIT(KConfigurationFile, "setting.txt");


// CLASS DECLARATION

/**
 *  CCConfiguration
 * 
 */
class CConfiguration : public CBase
	{
public:
	// Constructors and destructor

	/**
	 * Destructor.
	 */
	~CConfiguration();

	/**
	 * Two-phased constructor.
	 */
	static CConfiguration* NewL();

	/**
	 * Two-phased constructor.
	 */
	static CConfiguration* NewLC();
	
	/**
	 * Function load the last known settings from the predefined file.
	 */
	void LoadSettingFromFileL();
	
	/**
	 * Function updates its actual settings.
	 */
	void UpdateSettings( const TInt aLoudNotification,
						 const TInt aHiddenNotification,
						 const TInt aSecurityLevel,
						 const TDes &aPhone,
						 const TDes &aMail,
						 const TDes &aPin,
						 const TDes &aSoundFile);
	
	/**
	 * Funkcia nastavi cestu k zvukovemu suboru.
	 */
	void SetSoundFile( const TDesC &aSoundFile);
	
	/**
	 * Funkcia vrati 0 ak je konfiguracia uplna a spravna, inak:
	 * 1 - chyba cesta k suboru alarmu
	 * 2 - subor alarm ma nepodporovany format
	 * 3 - zle alebo chybajuce telefonne cislo
	 * 4 - chyba mail
	 * 5 - chybny format mailu
	 * 6 - ak nebolo zadane PIN
	 */
	TInt IsOk();
	
	/**
	 * Function saves the actual setting to the predefined file.
	 */
	void SaveSettingToFileL();

private:

	/**
	 * Constructor for performing 1st stage construction
	 */
	CConfiguration();

	/**
	 * EPOC default constructor for performing 2nd stage construction
	 */
	void ConstructL();
	
public:
	TInt iLoudNotification;
	TInt iHiddenNotification;
	TBuf<100> iSoundFile;
	TBuf<50> iPhone;
	TBuf<50> iMail;
	TBuf<50> iPin;
	TInt iSecurityLevel;
	
	//TPtr iPhone;
	//TPtr iMail;
	//TPtr iPin;
	};

#endif // CCONFIGURATION_H
